import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/http_data.dart';
import 'package:app/src/http/bean/wroks/address_bean.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/ui/route/helper/route_helper.dart';
import 'package:app/src/ui/route/works/public/items/ui_base.dart';
import 'package:app/src/ui/route/works/public/items/ui_card.dart';

import '../../../../../../http/bean/worksdo/hardware_return_bean.dart';
import '../../../../../../http/bean/worksdo/material_requisition_bean.dart';
import '../../../../../../http/bean/wroks/dispatchingaudit_bean.dart';
import '../../../../../../http/model/config_model.dart';
import '../../../../../dialog/dailog.dart';

///基本信息
class UiInfo {
  ///data 信息
  ///oldData 历史信息
  ///isPurStartDate 是否显示请购日期
  static Widget build(BuildContext context, HardwareReturnListBean? data,
      HardwareReturnListBean? oldData, StateSetter setState,
      {String? title, bool isPurStartDate = true}) {
    List<Widget> children = [];
    if (StringUtils.isEmpty(title)) {
      title = AppStrings.of(context).BaseInfo; //基本信息
    }
    children.add(UiBase.title(context, title)); //标题
    var isAllowEmpty = true;
    var isGrey = false;
    children.add(UiBase.item(context, AppStrings.of(context).Receiptnumber,
        data?.PickCode, oldData?.PickCode,
        isAllowEmpty: isAllowEmpty,
        defaultValue: AppStrings.of(context).Automaticgeneration,
        isGrey: isGrey)); //领料单号
    // children.add(UiBase.item(context, AppStrings.of(context).Documenttype,
    //     data?.PurCode, oldData?.PurCode,
    //     isAllowEmpty: isAllowEmpty,
    //     defaultValue: AppStrings.of(context).Automaticgeneration,
    //     isGrey: isGrey)); //单据类型
    // children.add(UiBase.item(
    //     context, AppStrings.of(context).Note, data?.PurCode, oldData?.PurCode,
    //     isAllowEmpty: isAllowEmpty,
    //     defaultValue: AppStrings.of(context).Automaticgeneration,
    //     isGrey: isGrey)); //备注
    children.add(UiBase.item(context, AppStrings.of(context).AddDate,
        data?.getAddDate(), oldData?.getAddDate(),
        isAllowEmpty: isAllowEmpty,
        defaultValue: AppStrings.of(context).Automaticgeneration,
        isGrey: isGrey)); //申请时间
    children.add(UiBase.item(context, AppStrings.of(context).UserPersonName,
        data?.PersonName, oldData?.PersonName,
        isAllowEmpty: isAllowEmpty,
        defaultValue: AppStrings.of(context).Automaticgeneration,
        isGrey: isGrey)); //申请人
    // children.add(UiBase.item(context, AppStrings.of(context).PersonName9,
    //     data?.PurCode, oldData?.PurCode,
    //     isAllowEmpty: isAllowEmpty,
    //     defaultValue: AppStrings.of(context).Automaticgeneration,
    //     isGrey: isGrey)); //确认人

    var column = UiBase.column(context, children);
    var card = UiCard.build(context, column);
    return card;
  }
}
